import Vue from 'vue'
Vue.directive('typewriter', {
  inserted: function (el, binding) {
	const text = binding.value
	let index = 0
	const intervalId = setInterval(() => {
	  if (index < text.length) {
		el.textContent += text[index]
		index++
	  } else {
		clearInterval(intervalId)
	  }
	}, 20) // 可以调整这个时间来改变打字速度
  },
})
